
import pandas as pd
import csv


qqnumber_data = []
name_data = []
saytime_data = []

numerindex = 0
pageindex = 1

filepath = '//Users//elsa//Desktop//proj//python//jd_maotai//learning_notebook-master//qqemail//uniqueqqdatautf8.csv'

csv_reader = csv.reader(open(filepath, encoding='utf-8'))
for row in csv_reader:
    #date|  name  |qq  
    rowarray =  len(row)  
    
    if rowarray>2 :
        numerindex = numerindex+1
        
        rowdate = row[0]
        rowname = row[1]
        rowqq = row[2]
        print(rowdate,rowname,rowqq)
        
        qqnumber_data.append(rowqq)
        name_data.append(rowname)
        saytime_data.append(rowdate)
             
        if numerindex%2000==0 :
            table=pd.DataFrame({'qq':qqnumber_data,'name':name_data,'datetime':saytime_data})
            table.to_csv(r'split_%d.csv' % (pageindex),encoding = "utf_8_sig")
            
            pageindex = pageindex+1
            
            qqnumber_data = []
            name_data = []
            saytime_data = []

    
